package com.caltco.cargo.ops.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName("project")
@Schema(description = "项目")
public class Project extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Schema(description = "用户Id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Schema(description = "项目名称")
    @TableField("project_name")
    @JsonProperty("projectName")
    private String projectName;

    @Schema(description = "项目描述")
    @TableField("description")
    @JsonProperty("description")
    private String description;

    @Schema(description = "项目结束时间")
    @TableField("project_end_time")
    @JsonProperty("projectEndTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss")
    private LocalDateTime projectEndTime;


    @Schema(description = "项目开始时间")
    @TableField("project_start_time")
    @JsonProperty("projectStartTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss")
    private LocalDateTime projectStartTime;

    @Schema(description = "项目码")
    @TableField("project_code")
    @JsonProperty("projectCode")
    private String projectCode;


    @Schema(description = "是否删除")
    @TableField("is_delete")
    @JsonProperty("isDelete")
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
